package org.mikeliu.review.exp5;

class Role
{
	protected String nameString;
	protected int age;
	public Role(String nameString, int age) 
	{
		super();
		this.nameString = nameString;
		this.age = age;
	}
	
}

class Employee extends Role
{
	protected String workIdString;
	protected String year,month,day;
	protected String levelString;
	public Employee(String nameString, int age, String workIdString, String year, String month, String day,
			String levelString) {
		super(nameString, age);
		this.workIdString = workIdString;
		this.year = year;
		this.month = month;
		this.day = day;
		this.levelString = levelString;
	}
}

class Faculty extends Employee
{
	public Faculty(String nameString, int age, String workIdString, String year, String month, String day,
			String levelString) {
		super(nameString, age, workIdString, year, month, day, levelString);
		// TODO Auto-generated constructor stub
	}

	
	
	public void show() {
		System.out.printf("我是%s，年龄%d岁。工号是%s，%s年%s月%s日入职。是一名教师，%s职称。\n",super.nameString,super.age,super.workIdString,super.year,Integer.parseInt(super.month),super.day,super.levelString);
	}
}

class Student extends Role
{
	private String studentNumberString;
	private String classNumberString;
	public Student(String nameString, int age, String studentNumberString, String classNumberString) 
	{
		super(nameString,age);
		this.studentNumberString = studentNumberString;
		this.classNumberString = classNumberString;
	}
	public void show()
	{
		System.out.printf("我是%s，年龄%d岁。学号是%s，来自%s班。\n",super.nameString,super.age,studentNumberString,classNumberString);
	}
}

class Staff extends Employee
{
	public Staff(String nameString, int age, String workIdString, String year, String month, String day,
			String levelString) {
		super(nameString, age, workIdString, year, month, day, levelString);
		// TODO Auto-generated constructor stub
	}
	public void show() {
		System.out.printf("我是%s，年龄%d岁。工号是%s，%s年%d月%s日入职。是一名%s。\n",super.nameString,super.age,super.workIdString,super.year,Integer.parseInt(super.month),super.day,super.levelString);
	}

	
}

public class Main {
    public static void main(String[] args) {
        Faculty fac = new Faculty("张三",32,"33006","2019","10","25","讲师");
        Student stu=new Student("李四",19,"20201103","202011");
        Staff sta = new Staff("王五",27,"32011","2015","06","17","教务员");        
        fac.show();
        sta.show();
        stu.show();
    }
}
